//
//  SendMsgView.swift
//  WatchShouChong Watch App
//
//  Created by yw on 2024/8/24.
//

import SwiftUI


struct SendMsgView: View {
    struct FeelingModel:Identifiable {
        var id:String = UUID().uuidString
        var name:String
        var img:String
        var remark:String = "-1"
    }
    
    let list:[FeelingModel] = [
        FeelingModel(name: "不高兴", img: "feeling_01",remark: "1000"),
        FeelingModel(name: "一般", img: "feeling_02",remark: "1001"),
        FeelingModel(name: "高兴", img: "feeling_03",remark: "1002"),
    
    ]
    /* 屏幕相关 */

    let kScreenW = WKInterfaceDevice.current().screenBounds.size.width
    var feelingAction:(_:(String) -> Void)
    
    var body: some View {
        VStack {
            VStack {
                Text("本次运动后,您的感觉如何")
                    .font(Font.system(size: 16, weight: .medium, design: .rounded))
                    .foregroundColor(.gray)
                    .padding(.bottom,6)
                HStack(alignment:.center,spacing: 6) {
                    ForEach(list){item in
                            Image(item.img)
                                .resizable()
                                .aspectRatio(contentMode: .fit)
                                .frame(width:48,height: 48)
                                .onTapGesture {
//                                    sendData(item: item)
                                    feelingAction(item.remark)
                                }
                    }
                }.padding(.horizontal,6)
            }
           
        }
        .frame(width: kScreenW - 20,height: 140)
//        .background(.black.opacity(0.3))
        .cornerRadius(10)
    }
    
//    private func sendData(item:FeelingModel) {
//        dismiss()
//    }
}


